//
//  TheredemptionViewController.m
//  TenThousand
//
//  Created by 我的 on 16/7/18.
//  Copyright © 2016年 baixue. All rights reserved.
//

#import "TheredemptionViewController.h"

@interface TheredemptionViewController ()

/**投资名 编号*/
@property (weak, nonatomic) IBOutlet UILabel *name;
/**投资金额*/
@property (weak, nonatomic) IBOutlet UILabel *money;
/**期限*/
@property (weak, nonatomic) IBOutlet UILabel *deadline;
/**起息日期*/
@property (weak, nonatomic) IBOutlet UILabel *dateOfValue;
/**违约金比例*/
@property (weak, nonatomic) IBOutlet UILabel *penaltyScale;
/**年利率*/
@property (weak, nonatomic) IBOutlet UILabel *annualRate;
/**预计收益*/
@property (weak, nonatomic) IBOutlet UILabel *expectIncome;
/**当前收益*/
@property (weak, nonatomic) IBOutlet UILabel *currentIncome;
/**申请日期*/
@property (weak, nonatomic) IBOutlet UILabel *applyDate;
/**违约金*/
@property (weak, nonatomic) IBOutlet UILabel *penalty;


@end

@implementation TheredemptionViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self createLeft:[UIImage imageNamed:@"ZHSZicon_03"] leftClick:^{
        [self.navigationController popViewControllerAnimated:YES];
    } right:nil rightClick:nil];
    self.navigationItem.title = @"赎回中的投资";
    
    
    [self setValue];
}

- (void)setValue{
    _name.text          = [NSString stringWithFormat:@"%@:%@", _model.Project, _model.Code];
    _money.text         = [NSString stringWithFormat:@"投资金额:%@", _model.Dedit];
    _deadline.text      = [NSString stringWithFormat:@"期限%@", _model.TeamYear];
    _dateOfValue.text   = [NSString stringWithFormat:@"起息日期:%@", _model.StartDate];
    _penaltyScale.text  = [NSString stringWithFormat:@"违约金比例:%@", _model.Rateweiyuejin];
    _annualRate.text    = [NSString stringWithFormat:@"年利率:%f", _model.Rate];
    _expectIncome.text  = [NSString stringWithFormat:@"预计收益%f", _model.CurrentAmount];
    _currentIncome.text = [NSString stringWithFormat:@"当前收益:%@", _model.ViolateAmount];
    _applyDate.text     = [NSString stringWithFormat:@"违约金:%@", _model.Weiyue];
}


/**取消*/
- (IBAction)cancel:(id)sender {
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    NSString *LoginId = [defaults objectForKey:@"LoginId"];
    
    
    NSDictionary *para = @{
                             @"BrrowListId" : _model.BrrowListId,
                             @"RedemId"  : _model.RedemId
                             };
    
    NSString *method = @"Redemp.GetDetelRedeemClear";
    
    [NetWorkManager requestWithType:HttpRequestTypePost withMethodName:method withParaments:para withSuccessBlock:^(NSDictionary *object) {
//        NSLog(@"%@", object);
        if ([object[@"Code"] isEqualToString:@"00000"]) {
            [self.navigationController popViewControllerAnimated:YES];
        }
    } withFailureBlock:^(NSError *error) {
//        NSLog(@"%@", error);
    } progress:^(float progress) {
        
    }];
}

@end
